<div
    bsModal
    #createOrEditModal="bs-modal"
    class="modal fade"
    tabindex="-1"
    role="dialog"
    aria-labelledby="createOrEditModal"
    aria-hidden="true"
    [config]="{ backdrop: 'static' }"
>
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #editForm="ngForm" novalidate (ngSubmit)="save()">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="!launch?.id">创建新的批次</span>
                        <span *ngIf="launch?.id">更改批次：{{ launch.code }}</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label
                            >编号
                            <span class="required">*</span>
                        </label>
                        <input
                            class="form-control"
                            type="text"
                            [disabled]="launch?.id"
                            name="launchCode"
                            [(ngModel)]="launch.code"
                            required
                        />
                    </div>
                    <div class="form-group">
                        <label
                            >名称
                            <span class="required">*</span>
                        </label>
                        <input class="form-control" type="text" name="launchName" [(ngModel)]="launch.name" required />
                    </div>
                    <div class="form-group">
                        <label
                            >阶段
                            <span class="required">*</span>
                        </label>
                        <select name="stageName" class="form-control" [(ngModel)]="launch.stage" required>
                            <option *ngFor="let stage of stages" [value]="stage.value">{{ stage.displayText }}</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label>描述信息</label>
                        <textarea
                            class="form-control"
                            name="launchDescription"
                            cols="30"
                            rows="3"
                            [(ngModel)]="launch.description"
                        ></textarea>
                    </div>
                    <div class="row">
                        <div class="col-md-4">
                            <label
                                >计划结束时间
                                <span>*</span>
                            </label>
                            <p-calendar
                                [(ngModel)]="plannedFinishDate_Date"
                                name="plannedFinishDate"
                                dateFormat="yy-mm-dd"
                                [yearNavigator]="true"
                                yearRange="2000:2030"
                                [locale]="calendarHelper.cn"
                            ></p-calendar>
                        </div>
                        <div class="col-md-4">
                            <label
                                >计划齐套时间
                                <span>*</span>
                            </label>
                            <p-calendar
                                [(ngModel)]="plannedCompletionDate_Date"
                                name="plannedCompletionDate"
                                dateFormat="yy-mm-dd"
                                [yearNavigator]="true"
                                yearRange="2000:2030"
                                [locale]="calendarHelper.cn"
                            ></p-calendar>
                        </div>
                        <div class="col-md-4">
                            <label
                                >计划交付时间
                                <span>*</span>
                            </label>
                            <p-calendar
                                [(ngModel)]="plannedDeliveryDate_Date"
                                name="plannedDeliveryDate"
                                dateFormat="yy-mm-dd"
                                [yearNavigator]="true"
                                yearRange="2000:2030"
                                [locale]="calendarHelper.cn"
                            ></p-calendar>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">
                        {{ l("Cancel") }}
                    </button>
                    <button
                        type="submit"
                        class="btn btn-primary blue"
                        [disabled]="!editForm.form.valid"
                        [buttonBusy]="saving"
                        [busyText]="'保存中...'"
                    >
                        <i class="fa fa-save"></i>
                        <span>{{ l("Save") }}</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
